<template>
    <div class="gift-count">
        <Header />
        <div class="gift-count-container">
            <div class="header-section">
                <h1 class="title">B站盲盒礼物统计</h1>
                <div class="room-input">
                    <input v-model="roomKeyValue" placeholder="请输入房间号" class="room-input-field" />
                    <button @click="initClient" class="start-btn">开始监听</button>
                    <button @click="stopClient" class="start-btn">停止监听</button>
                    <button @click="test" class="test-btn">测试数据</button>
                </div>
            </div>

            <div class="stats-section">
                <div class="total-stats">
                    <div class="stat-item">
                        <span class="stat-label">总盈亏:</span>
                        <span class="stat-value" :class="{ 'positive': total > 0, 'negative': total < 0 }">{{ total
                            }}</span>
                    </div>
                </div>

                <div class="leaderboard">
                    <div class="leaderboard-item">
                        <div class="leaderboard-title">欧皇榜</div>
                        <div v-if="lucky && lucky.userName !== '无'" class="leaderboard-user">
                            <img :src="lucky.face" class="user-avatar" />
                            <div class="user-info">
                                <div class="user-name">{{ lucky.userName }}</div>
                                <div class="user-profit positive">+{{ lucky.finalPrice }}</div>
                            </div>
                        </div>
                        <div v-else class="no-data">暂无数据</div>
                    </div>

                    <div class="leaderboard-item">
                        <div class="leaderboard-title">非酋榜</div>
                        <div v-if="unlucky && unlucky.userName !== '无'" class="leaderboard-user">
                            <img :src="unlucky.face" class="user-avatar" />
                            <div class="user-info">
                                <div class="user-name">{{ unlucky.userName }}</div>
                                <div class="user-profit negative">{{ unlucky.finalPrice }}</div>
                            </div>
                        </div>
                        <div v-else class="no-data">暂无数据</div>
                    </div>
                </div>
            </div>

            <div class="user-section">
                <div class="current-user" v-if="nowUser.userName">
                    <img :src="nowUser.face" class="user-avatar large" />
                    <div class="user-details">
                        <div class="user-name">{{ nowUser.userName }}</div>
                        <div class="user-profit" :class="{ 'positive': nowUser.isZhuan, 'negative': !nowUser.isZhuan }">
                            {{ nowUser.isZhuan ? '赚了: +' : '亏了: ' }}{{ nowUser.price }}
                        </div>
                        <div class="user-total-profit"
                            :class="{ 'positive': nowUser.finalPrice > 0, 'negative': nowUser.finalPrice < 0 }">
                            总盈亏: {{ nowUser.finalPrice }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import ChatClientDirectWeb from '@/api/chat/ChatClientDirectWeb'
import Header from '@/components/Header.vue'
export default {
    name: 'GiftCount2',
    components: {
        Header,
    },
    data() {
        return {
            count: 0,
            chatClient: null,// ws 连接对象
            labelStr: '【温心盲盒姬提醒您】', // 标题
            roomKeyValue: '', // 房间号
            nowUser: {
                userName: '无',
                price: 0,
                uid: null,
                isZhuan: true,
                finalPrice: 0.0, // 最终价格
                face: null// 头像
            }, // 当前这次送礼人是谁
            defaultStr: '无', // 默认5无
            lucky: {
                userName: '无',
                price: 0,
                uid: null,
                finalPrice: 0.0, // 最终价格
                face: null// 头像
            }, // 欧皇榜
            unlucky: {
                userName: '无',
                price: 0,
                uid: null,
                finalPrice: 0.0, // 最终价格
                face: null// 头像
            }, // 非酋榜
            total: 0.0, // 总共赚/亏 多少钱
            isLose: false, // 是否赚 false:赚 ，true:不赚
            temp: {
                userName: '无',
                price: 0,
                uid: null,
                isZhuan: true,
                finalPrice: 0.0, // 最终价格
                face: null// 头像
            }, // 中间临时数据
            nowUserMap: null, //
            luckyMap: null, // 所有欧皇map
            unluckyMap: null, // 所有非酋map
            nowUserList: [],
            luckyList: [], // 所有欧皇数组
            unluckyList: [], // 所有非酋数组
            testJsonList: [
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"a260c8fd-1113-40d1-80a9-e2f05a9932d8","batch_combo_send":{"action":"投喂","batch_combo_id":"a260c8fd-1113-40d1-80a9-e2f05a9932d8","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":9000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"gift_id":32126,"gift_name":"棉花糖","gift_num":1,"send_master":null,"uid":312620722,"uname":"御靈AC"},"beatId":"","biz_source":"live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":9000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":1,"combo_send":{"action":"投喂","combo_id":"e08e828b-e525-475c-9b45-bdf3e29d60aa","combo_num":1,"gift_id":32126,"gift_name":"棉花糖","gift_num":1,"send_master":null,"uid":312620722,"uname":"御靈AC"},"combo_stay_time":5,"combo_total_coin":9000,"crit_prob":0,"demarcation":2,"discount_price":9000,"dmscore":672,"draw":0,"effect":0,"effect_block":0,"face":"https://i1.hdslb.com/bfs/face/3e6369c95dfc57b3334ac93c86c00a43f6b3ce08.jpg","face_effect":{},"face_effect_id":0,"face_effect_type":0,"face_effect_v2":{"id":0,"type":0},"float_sc_resource_id":0,"giftId":32126,"giftName":"棉花糖","giftType":0,"gift_info":{"effect_id":0,"gif":"https://i0.hdslb.com/bfs/live/97652a724c610b3e7df2f49a4fc82769a4b0c062.gif","has_imaged_gift":0,"img_basic":"https://s1.hdslb.com/bfs/live/b555682af41551c28f8ad19dc5c4ed87943c84f4.png","webp":"https://i0.hdslb.com/bfs/live/3dfb753065c967653dc35be1df85322188a88625.webp"},"gift_tag":[],"gold":0,"group_medal":null,"guard_level":0,"is_first":true,"is_join_receiver":false,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":1,"medal_color":398668,"medal_color_border":398668,"medal_color_end":6850801,"medal_color_start":398668,"medal_level":26,"medal_name":"次糖么","special":"","target_id":25487242},"name_color":"","num":1,"original_gift_name":"","price":9000,"rcost":63325519,"receive_user_info":{"uid":25487242,"uname":"兮兮兮唐"},"receiver_uinfo":{"base":{"face":"https://i1.hdslb.com/bfs/face/191cf39a3ff839b39599a3a1a74243da13a53974.jpg","is_mystery":false,"name":"兮兮兮唐","name_color":0,"name_color_str":"","official_info":{"desc":"","role":7,"title":"bilibili直播高能主播","type":0},"origin_info":{"face":"https://i1.hdslb.com/bfs/face/191cf39a3ff839b39599a3a1a74243da13a53974.jpg","name":"兮兮兮唐"},"risk_ctrl_info":null},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":25487242,"wealth":null},"remain":0,"rnd":"4668329844197732864","send_master":null,"sender_uinfo":{"base":{"face":"https://i1.hdslb.com/bfs/face/3e6369c95dfc57b3334ac93c86c00a43f6b3ce08.jpg","is_mystery":false,"name":"御靈AC","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i1.hdslb.com/bfs/face/3e6369c95dfc57b3334ac93c86c00a43f6b3ce08.jpg","name":"御靈AC"},"risk_ctrl_info":null},"guard":null,"guard_leader":null,"medal":{"color":398668,"color_border":398668,"color_end":6850801,"color_start":398668,"guard_icon":"","guard_level":0,"honor_icon":"","id":0,"is_light":1,"level":26,"name":"次糖么","ruid":25487242,"score":50043593,"typ":0,"user_receive_count":0,"v2_medal_color_border":"#58A1F8FF","v2_medal_color_end":"#4775EFCC","v2_medal_color_level":"#000B7099","v2_medal_color_start":"#4775EFCC","v2_medal_color_text":"#FFFFFFFF"},"title":null,"uhead_frame":null,"uid":312620722,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":1,"svga_block":0,"switch":true,"tag_image":"","tid":"4668329844197732864","timestamp":1753960999,"top_list":null,"total_coin":15000,"uid":312620722,"uname":"御靈AC","wealth_level":27}',
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"dbb6b4c6-23d0-4ab1-926e-0697bd57045d","batch_combo_send":{"action":"投喂","batch_combo_id":"dbb6b4c6-23d0-4ab1-926e-0697bd57045d","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":16000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"gift_id":32128,"gift_name":"爱心抱枕","gift_num":3,"send_master":null,"uid":7332387,"uname":"果丹皮泥好芽"},"beatId":"0","biz_source":"Live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":16000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":0,"combo_send":{"action":"投喂","combo_id":"d9228821-1d23-46f1-9cdb-1743ade239e9","combo_num":3,"gift_id":32128,"gift_name":"爱心抱枕","gift_num":3,"send_master":null,"uid":7332387,"uname":"果丹皮泥好芽"},"combo_stay_time":8,"combo_total_coin":48000,"crit_prob":0,"demarcation":2,"discount_price":16000,"dmscore":616,"draw":0,"effect":0,"effect_block":0,"face":"https://i0.hdslb.com/bfs/face/37d9f25b480decc2843eff3874a3f17e93a5829e.jpg","face_effect":{},"face_effect_id":0,"face_effect_type":0,"face_effect_v2":{"id":0,"type":0},"float_sc_resource_id":0,"giftId":32128,"giftName":"爱心抱枕","giftType":0,"gift_info":{"effect_id":0,"gif":"https://i0.hdslb.com/bfs/live/ae80d80ea758ff08fb4e2c4226ab7b5011b728a6.gif","has_imaged_gift":0,"img_basic":"https://s1.hdslb.com/bfs/live/824714c830966d7bec381e35ef808b1f478e21ee.png","webp":"https://i0.hdslb.com/bfs/live/32c8ee42566501822d8ecc68b33cd2c64937266a.webp"},"gift_tag":[],"gold":0,"group_medal":null,"guard_level":0,"is_first":true,"is_join_receiver":false,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":1,"medal_color":13081892,"medal_color_border":13081892,"medal_color_end":13081892,"medal_color_start":13081892,"medal_level":18,"medal_name":"次糖么","special":"","target_id":25487242},"name_color":"","num":3,"original_gift_name":"","price":16000,"rcost":63324939,"receive_user_info":{"uid":25487242,"uname":"兮兮兮唐"},"receiver_uinfo":{"base":{"face":"https://i1.hdslb.com/bfs/face/191cf39a3ff839b39599a3a1a74243da13a53974.jpg","is_mystery":false,"name":"兮兮兮唐","name_color":0,"name_color_str":"","official_info":{"desc":"","role":7,"title":"bilibili直播高能主播","type":0},"origin_info":{"face":"https://i1.hdslb.com/bfs/face/191cf39a3ff839b39599a3a1a74243da13a53974.jpg","name":"兮兮兮唐"},"risk_ctrl_info":null},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":25487242,"wealth":null},"remain":0,"rnd":"4668329585580972545","send_master":null,"sender_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/37d9f25b480decc2843eff3874a3f17e93a5829e.jpg","is_mystery":false,"name":"果丹皮泥好芽","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/37d9f25b480decc2843eff3874a3f17e93a5829e.jpg","name":"果丹皮泥好芽"},"risk_ctrl_info":null},"guard":null,"guard_leader":null,"medal":{"color":13081892,"color_border":13081892,"color_end":13081892,"color_start":13081892,"guard_icon":"","guard_level":0,"honor_icon":"","id":0,"is_light":1,"level":18,"name":"次糖么","ruid":25487242,"score":407640,"typ":0,"user_receive_count":0,"v2_medal_color_border":"#DC6B6B99","v2_medal_color_end":"#DC6B6B99","v2_medal_color_level":"#81001F99","v2_medal_color_start":"#DC6B6B99","v2_medal_color_text":"#FFFFFFFF"},"title":null,"uhead_frame":null,"uid":7332387,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":3,"svga_block":0,"switch":true,"tag_image":"","tid":"4668329585580972545","timestamp":1753960937,"top_list":null,"total_coin":45000,"uid":7332387,"uname":"果丹皮泥好芽","wealth_level":36}',
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"4c726ffe-889a-4750-b2ab-67061d96fe70","batch_combo_send":{"action":"投喂","batch_combo_id":"4c726ffe-889a-4750-b2ab-67061d96fe70","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":2000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"gift_id":32125,"gift_name":"电影票","gift_num":2,"send_master":null,"uid":7332387,"uname":"果丹皮泥好芽"},"beatId":"0","biz_source":"Live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":2000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":1,"combo_send":{"action":"投喂","combo_id":"42c014c6-fb2f-4ea3-b064-fe909655ee80","combo_num":2,"gift_id":32125,"gift_name":"电影票","gift_num":2,"send_master":null,"uid":7332387,"uname":"果丹皮泥好芽"},"combo_stay_time":5,"combo_total_coin":4000,"crit_prob":0,"demarcation":2,"discount_price":2000,"dmscore":616,"draw":0,"effect":0,"effect_block":0,"face":"https://i0.hdslb.com/bfs/face/37d9f25b480decc2843eff3874a3f17e93a5829e.jpg","face_effect":{},"face_effect_id":0,"face_effect_type":0,"face_effect_v2":{"id":0,"type":0},"float_sc_resource_id":0,"giftId":32125,"giftName":"电影票","giftType":0,"gift_info":{"effect_id":0,"gif":"https://i0.hdslb.com/bfs/live/ef9b630931080a27d47c39aee03744f2f6a6df19.gif","has_imaged_gift":0,"img_basic":"https://s1.hdslb.com/bfs/live/20864a10beaea541c7dce264d5bbc56676d63e4f.png","webp":"https://i0.hdslb.com/bfs/live/0879943234303141c3a0ca680df239a278ac1e37.webp"},"gift_tag":[],"gold":0,"group_medal":null,"guard_level":0,"is_first":true,"is_join_receiver":false,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":1,"medal_color":13081892,"medal_color_border":13081892,"medal_color_end":13081892,"medal_color_start":13081892,"medal_level":18,"medal_name":"次糖么","special":"","target_id":25487242},"name_color":"","num":2,"original_gift_name":"","price":2000,"rcost":63324499,"receive_user_info":{"uid":25487242,"uname":"兮兮兮唐"},"receiver_uinfo":{"base":{"face":"https://i1.hdslb.com/bfs/face/191cf39a3ff839b39599a3a1a74243da13a53974.jpg","is_mystery":false,"name":"兮兮兮唐","name_color":0,"name_color_str":"","official_info":{"desc":"","role":7,"title":"bilibili直播高能主播","type":0},"origin_info":{"face":"https://i1.hdslb.com/bfs/face/191cf39a3ff839b39599a3a1a74243da13a53974.jpg","name":"兮兮兮唐"},"risk_ctrl_info":null},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":25487242,"wealth":null},"remain":0,"rnd":"4668329585580972544","send_master":null,"sender_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/37d9f25b480decc2843eff3874a3f17e93a5829e.jpg","is_mystery":false,"name":"果丹皮泥好芽","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/37d9f25b480decc2843eff3874a3f17e93a5829e.jpg","name":"果丹皮泥好芽"},"risk_ctrl_info":null},"guard":null,"guard_leader":null,"medal":{"color":13081892,"color_border":13081892,"color_end":13081892,"color_start":13081892,"guard_icon":"","guard_level":0,"honor_icon":"","id":0,"is_light":1,"level":18,"name":"次糖么","ruid":25487242,"score":407640,"typ":0,"user_receive_count":0,"v2_medal_color_border":"#DC6B6B99","v2_medal_color_end":"#DC6B6B99","v2_medal_color_level":"#81001F99","v2_medal_color_start":"#DC6B6B99","v2_medal_color_text":"#FFFFFFFF"},"title":null,"uhead_frame":null,"uid":7332387,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":2,"svga_block":0,"switch":true,"tag_image":"","tid":"4668329585580972544","timestamp":1753960937,"top_list":null,"total_coin":30000,"uid":7332387,"uname":"果丹皮泥好芽","wealth_level":36}',
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"0db940e2-a6d5-4e95-9525-137b2d48574c","batch_combo_send":{"action":"投喂","batch_combo_id":"0db940e2-a6d5-4e95-9525-137b2d48574c","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":9000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"gift_id":32126,"gift_name":"棉花糖","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"beatId":"","biz_source":"live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":9000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":1,"combo_send":{"action":"投喂","combo_id":"89bf8e73-5468-41be-b9b9-623766dad834","combo_num":1,"gift_id":32126,"gift_name":"棉花糖","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"combo_stay_time":5,"combo_total_coin":9000,"crit_prob":0,"demarcation":2,"discount_price":9000,"dmscore":1512,"draw":0,"effect":0,"effect_block":0,"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","face_effect_id":0,"face_effect_type":0,"float_sc_resource_id":0,"giftId":32126,"giftName":"棉花糖","giftType":0,"gift_tag":[],"gold":0,"group_medal":null,"guard_level":2,"is_first":true,"is_join_receiver":true,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":0,"medal_color":0,"medal_color_border":0,"medal_color_end":0,"medal_color_start":0,"medal_level":0,"medal_name":"","special":"","target_id":0},"name_color":"#E17AFF","num":1,"original_gift_name":"","price":9000,"rcost":9159095,"receive_user_info":{"uid":3546577291446858,"uname":"漫听-阚卿"},"receiver_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","is_mystery":false,"name":"漫听-阚卿","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3546577291446858,"wealth":null},"remain":0,"rnd":"4488841347532364800","send_master":null,"sender_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","is_mystery":false,"name":"Miyyooo","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3493089012353967,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":1,"svga_block":0,"switch":true,"tag_image":"","tid":"4488841347532364800","timestamp":1711167606,"top_list":null,"total_coin":15000,"uid":3493089012353967,"uname":"Miyyooo","wealth_level":54}',
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"bdea3fa8-7a38-400a-b2b3-fec5bff71c41","batch_combo_send":{"action":"投喂","batch_combo_id":"bdea3fa8-7a38-400a-b2b3-fec5bff71c41","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":16000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"gift_id":33877,"gift_name":"神奇金杯","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"beatId":"","biz_source":"live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":16000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":1,"combo_send":{"action":"投喂","combo_id":"5f2d81ef-6d19-4510-921b-8a7c2a1040c4","combo_num":1,"gift_id":33877,"gift_name":"神奇金杯","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"combo_stay_time":5,"combo_total_coin":16000,"crit_prob":0,"demarcation":2,"discount_price":16000,"dmscore":1512,"draw":0,"effect":0,"effect_block":0,"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","face_effect_id":0,"face_effect_type":0,"float_sc_resource_id":0,"giftId":33877,"giftName":"神奇金杯","giftType":0,"gift_tag":[],"gold":0,"group_medal":null,"guard_level":2,"is_first":true,"is_join_receiver":true,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":0,"medal_color":0,"medal_color_border":0,"medal_color_end":0,"medal_color_start":0,"medal_level":0,"medal_name":"","special":"","target_id":0},"name_color":"#E17AFF","num":1,"original_gift_name":"","price":16000,"rcost":9159165,"receive_user_info":{"uid":3546577291446858,"uname":"漫听-阚卿"},"receiver_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","is_mystery":false,"name":"漫听-阚卿","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3546577291446858,"wealth":null},"remain":0,"rnd":"4488841370731074048","send_master":null,"sender_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","is_mystery":false,"name":"Miyyooo","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3493089012353967,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":1,"svga_block":0,"switch":true,"tag_image":"","tid":"4488841370731074048","timestamp":1711167612,"top_list":null,"total_coin":15000,"uid":3493089012353967,"uname":"Miyyooo","wealth_level":54}',
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"0db940e2-a6d5-4e95-9525-137b2d48574c","batch_combo_send":{"action":"投喂","batch_combo_id":"0db940e2-a6d5-4e95-9525-137b2d48574c","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":9000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"gift_id":32126,"gift_name":"棉花糖","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"beatId":"","biz_source":"live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":9000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":1,"combo_send":{"action":"投喂","combo_id":"89bf8e73-5468-41be-b9b9-623766dad834","combo_num":1,"gift_id":32126,"gift_name":"棉花糖","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"combo_stay_time":5,"combo_total_coin":9000,"crit_prob":0,"demarcation":2,"discount_price":9000,"dmscore":1512,"draw":0,"effect":0,"effect_block":0,"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","face_effect_id":0,"face_effect_type":0,"float_sc_resource_id":0,"giftId":32126,"giftName":"棉花糖","giftType":0,"gift_tag":[],"gold":0,"group_medal":null,"guard_level":2,"is_first":true,"is_join_receiver":true,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":0,"medal_color":0,"medal_color_border":0,"medal_color_end":0,"medal_color_start":0,"medal_level":0,"medal_name":"","special":"","target_id":0},"name_color":"#E17AFF","num":1,"original_gift_name":"","price":9000,"rcost":9159095,"receive_user_info":{"uid":3546577291446858,"uname":"漫听-阚卿"},"receiver_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","is_mystery":false,"name":"漫听-阚卿","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3546577291446858,"wealth":null},"remain":0,"rnd":"4488841347532364800","send_master":null,"sender_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","is_mystery":false,"name":"Miyyooo","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3493089012353967,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":1,"svga_block":0,"switch":true,"tag_image":"","tid":"4488841347532364800","timestamp":1711167606,"top_list":null,"total_coin":15000,"uid":3493089012353967,"uname":"Miyyooo","wealth_level":54}',
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"fead68a2-ece8-44ba-9036-efd702d51536","batch_combo_send":{"action":"投喂","batch_combo_id":"fead68a2-ece8-44ba-9036-efd702d51536","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":16000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"gift_id":33877,"gift_name":"神奇金杯","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"beatId":"","biz_source":"live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":16000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":1,"combo_send":{"action":"投喂","combo_id":"d1f6f3d3-8dde-40f2-999d-599ce68d9a80","combo_num":1,"gift_id":33877,"gift_name":"神奇金杯","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"combo_stay_time":5,"combo_total_coin":16000,"crit_prob":0,"demarcation":2,"discount_price":16000,"dmscore":1512,"draw":0,"effect":0,"effect_block":0,"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","face_effect_id":0,"face_effect_type":0,"float_sc_resource_id":0,"giftId":33877,"giftName":"神奇金杯","giftType":0,"gift_tag":[],"gold":0,"group_medal":null,"guard_level":2,"is_first":true,"is_join_receiver":true,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":0,"medal_color":0,"medal_color_border":0,"medal_color_end":0,"medal_color_start":0,"medal_level":0,"medal_name":"","special":"","target_id":0},"name_color":"#E17AFF","num":1,"original_gift_name":"","price":16000,"rcost":9159165,"receive_user_info":{"uid":3546577291446858,"uname":"漫听-阚卿"},"receiver_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","is_mystery":false,"name":"漫听-阚卿","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3546577291446858,"wealth":null},"remain":0,"rnd":"4488841364615865856","send_master":null,"sender_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","is_mystery":false,"name":"Miyyooo","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3493089012353967,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":1,"svga_block":0,"switch":true,"tag_image":"","tid":"4488841364615865856","timestamp":1711167610,"top_list":null,"total_coin":15000,"uid":3493089012353967,"uname":"Miyyooo","wealth_level":54}',
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"c43b3758-f53d-4eba-9fd8-db8422da34c5","batch_combo_send":{"action":"投喂","batch_combo_id":"c43b3758-f53d-4eba-9fd8-db8422da34c5","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":9000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"gift_id":32126,"gift_name":"棉花糖","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"beatId":"","biz_source":"live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":9000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":1,"combo_send":{"action":"投喂","combo_id":"c19aadc2-32a6-4a50-a009-eff07ca37fc7","combo_num":1,"gift_id":32126,"gift_name":"棉花糖","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"combo_stay_time":5,"combo_total_coin":9000,"crit_prob":0,"demarcation":2,"discount_price":9000,"dmscore":1512,"draw":0,"effect":0,"effect_block":0,"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","face_effect_id":0,"face_effect_type":0,"float_sc_resource_id":0,"giftId":32126,"giftName":"棉花糖","giftType":0,"gift_tag":[],"gold":0,"group_medal":null,"guard_level":2,"is_first":true,"is_join_receiver":true,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":0,"medal_color":0,"medal_color_border":0,"medal_color_end":0,"medal_color_start":0,"medal_level":0,"medal_name":"","special":"","target_id":0},"name_color":"#E17AFF","num":1,"original_gift_name":"","price":9000,"rcost":9159095,"receive_user_info":{"uid":3546577291446858,"uname":"漫听-阚卿"},"receiver_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","is_mystery":false,"name":"漫听-阚卿","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3546577291446858,"wealth":null},"remain":0,"rnd":"4488841340620195328","send_master":null,"sender_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","is_mystery":false,"name":"Miyyooo","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3493089012353967,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":1,"svga_block":0,"switch":true,"tag_image":"","tid":"4488841340620195328","timestamp":1711167605,"top_list":null,"total_coin":15000,"uid":3493089012353967,"uname":"Miyyooo","wealth_level":54}',
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"bc68b732-870f-4b1b-bf3c-f4becc36cb0c","batch_combo_send":{"action":"投喂","batch_combo_id":"bc68b732-870f-4b1b-bf3c-f4becc36cb0c","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":16000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"gift_id":33877,"gift_name":"神奇金杯","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"beatId":"","biz_source":"live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":16000,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":15000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":1,"combo_send":{"action":"投喂","combo_id":"7a159b20-325a-494f-a0dd-3826b2a946f8","combo_num":1,"gift_id":33877,"gift_name":"神奇金杯","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"combo_stay_time":5,"combo_total_coin":16000,"crit_prob":0,"demarcation":2,"discount_price":16000,"dmscore":1512,"draw":0,"effect":0,"effect_block":0,"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","face_effect_id":0,"face_effect_type":0,"float_sc_resource_id":0,"giftId":33877,"giftName":"神奇金杯","giftType":0,"gift_tag":[],"gold":0,"group_medal":null,"guard_level":2,"is_first":true,"is_join_receiver":true,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":0,"medal_color":0,"medal_color_border":0,"medal_color_end":0,"medal_color_start":0,"medal_level":0,"medal_name":"","special":"","target_id":0},"name_color":"#E17AFF","num":1,"original_gift_name":"","price":16000,"rcost":9159165,"receive_user_info":{"uid":3546577291446858,"uname":"漫听-阚卿"},"receiver_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","is_mystery":false,"name":"漫听-阚卿","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3546577291446858,"wealth":null},"remain":0,"rnd":"4488841334207117312","send_master":null,"sender_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","is_mystery":false,"name":"Miyyooo","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3493089012353967,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":1,"svga_block":0,"switch":true,"tag_image":"","tid":"4488841334207117312","timestamp":1711167603,"top_list":null,"total_coin":15000,"uid":3493089012353967,"uname":"Miyyooo","wealth_level":54}',
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"bc68b732-870f-4b1b-bf3c-f4becc36cb0c","batch_combo_send":{"action":"投喂","batch_combo_id":"bc68b732-870f-4b1b-bf3c-f4becc36cb0c","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":5200,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":5000},"gift_id":33877,"gift_name":"神奇金杯","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"beatId":"","biz_source":"live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":5200,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":5000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":1,"combo_send":{"action":"投喂","combo_id":"7a159b20-325a-494f-a0dd-3826b2a946f8","combo_num":1,"gift_id":33877,"gift_name":"神奇金杯","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"Miyyooo"},"combo_stay_time":5,"combo_total_coin":16000,"crit_prob":0,"demarcation":2,"discount_price":16000,"dmscore":1512,"draw":0,"effect":0,"effect_block":0,"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","face_effect_id":0,"face_effect_type":0,"float_sc_resource_id":0,"giftId":33877,"giftName":"神奇金杯","giftType":0,"gift_tag":[],"gold":0,"group_medal":null,"guard_level":2,"is_first":true,"is_join_receiver":true,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":0,"medal_color":0,"medal_color_border":0,"medal_color_end":0,"medal_color_start":0,"medal_level":0,"medal_name":"","special":"","target_id":0},"name_color":"#E17AFF","num":1,"original_gift_name":"","price":16000,"rcost":9159165,"receive_user_info":{"uid":3546577291446858,"uname":"漫听-阚卿"},"receiver_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","is_mystery":false,"name":"漫听-阚卿","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3546577291446858,"wealth":null},"remain":0,"rnd":"4488841334207117312","send_master":null,"sender_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","is_mystery":false,"name":"Miyyooo","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"Miyyooo"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3493089012353967,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":1,"svga_block":0,"switch":true,"tag_image":"","tid":"4488841334207117312","timestamp":1711167603,"top_list":null,"total_coin":15000,"uid":3493089012353967,"uname":"Miyyooo","wealth_level":54}',
                '{"action":"投喂","bag_gift":null,"batch_combo_id":"bc68b732-870f-4b1b-bf3c-f4becc36cb0c","batch_combo_send":{"action":"投喂","batch_combo_id":"bc68b732-870f-4b1b-bf3c-f4becc36cb0c","batch_combo_num":1,"blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":5200,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":5000},"gift_id":33877,"gift_name":"神奇金杯","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"test1"},"beatId":"","biz_source":"live","blind_gift":{"blind_gift_config_id":51,"from":0,"gift_action":"爆出","gift_tip_price":5200,"original_gift_id":32251,"original_gift_name":"心动盲盒","original_gift_price":5000},"broadcast_id":0,"coin_type":"gold","combo_resources_id":1,"combo_send":{"action":"投喂","combo_id":"7a159b20-325a-494f-a0dd-3826b2a946f8","combo_num":1,"gift_id":33877,"gift_name":"神奇金杯","gift_num":1,"send_master":null,"uid":3493089012353967,"uname":"test1"},"combo_stay_time":5,"combo_total_coin":16000,"crit_prob":0,"demarcation":2,"discount_price":16000,"dmscore":1512,"draw":0,"effect":0,"effect_block":0,"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","face_effect_id":0,"face_effect_type":0,"float_sc_resource_id":0,"giftId":33877,"giftName":"神奇金杯","giftType":0,"gift_tag":[],"gold":0,"group_medal":null,"guard_level":2,"is_first":true,"is_join_receiver":true,"is_naming":false,"is_special_batch":0,"magnification":1,"medal_info":{"anchor_roomid":0,"anchor_uname":"","guard_level":0,"icon_id":0,"is_lighted":0,"medal_color":0,"medal_color_border":0,"medal_color_end":0,"medal_color_start":0,"medal_level":0,"medal_name":"","special":"","target_id":0},"name_color":"#E17AFF","num":1,"original_gift_name":"","price":16000,"rcost":9159165,"receive_user_info":{"uid":3546577291446858,"uname":"漫听-阚卿"},"receiver_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","is_mystery":false,"name":"漫听-阚卿","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/f9516d8625bfe7829c500f8b2eaa7c1805bd6a94.jpg","name":"漫听-阚卿"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3546577291446858,"wealth":null},"remain":0,"rnd":"4488841334207117312","send_master":null,"sender_uinfo":{"base":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","is_mystery":false,"name":"test1","name_color":0,"name_color_str":"","official_info":{"desc":"","role":0,"title":"","type":-1},"origin_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"test1"},"risk_ctrl_info":{"face":"https://i0.hdslb.com/bfs/face/7309629379c24813c382a90e767a8e2d4adb24d3.jpg","name":"test1"}},"guard":null,"guard_leader":null,"medal":null,"title":null,"uhead_frame":null,"uid":3493089012353967,"wealth":null},"silver":0,"super":0,"super_batch_gift_num":1,"super_gift_num":1,"svga_block":0,"switch":true,"tag_image":"","tid":"4488841334207117312","timestamp":1711167603,"top_list":null,"total_coin":15000,"uid":3493089012353967,"uname":"test1","wealth_level":54}'

            ]
        }
    },
    beforeDestroy() {
        if (this.chatClient) {
            this.chatClient.stop()
        }
    },
    methods: {
        // 测试
        test() {
            const randomIndex = Math.floor(Math.random() * this.testJsonList.length) // 生成随机索引
            let tesjson = this.testJsonList[randomIndex]
            this.onAddGift2(tesjson)
        },
        // 初始化数据
        init() {
            this.nowUserMap = new Map()
            this.unluckyMap = new Map()
            this.luckyMap = new Map()
        },
        // 初始化客户端 ws 连接
        initClient() {
            if(!this.roomKeyValue){
                this.$message.error('请先输入房间号')
                return
            }
            this.chatClient = new ChatClientDirectWeb(this.roomKeyValue)
            this.chatClient.onAddText = this.onAddText
            this.chatClient.onAddGift = this.onAddGift
            this.chatClient.start()
        },
        stopClient(){
            if(this.chatClient){
                this.chatClient.stop()
            }
        },
        // 收到礼物
        onAddGift2(data) {
            let dataJson = JSON.parse(data)
            let num = dataJson.super_gift_num
            if (dataJson.blind_gift && dataJson.batch_combo_send) {
                let face = dataJson.receiver_uinfo.base.face
                let sendUser = dataJson.batch_combo_send
                let blindGift = sendUser.blind_gift
                let userName = sendUser.uname
                let uid = sendUser.uid
                // console.log('用户信息', sendUser, '礼物信息', blindGift)
                // 中间价
                let price = ((blindGift.gift_tip_price - blindGift.original_gift_price) * num / 1000).toFixed(1)
                this.total = (parseFloat(this.total) + parseFloat(price)).toFixed(1)
                // 是否赚了
                let isZhuan
                // 当前用户的总共赚/亏的价格
                let finalPrice = price

                let tempUser
                if (this.nowUserMap && this.nowUserMap.has(userName)) {
                    tempUser = this.nowUserMap.get(userName)
                    if (tempUser.userName == userName) {
                        finalPrice = (parseFloat(tempUser.finalPrice) + parseFloat(price)).toFixed(1)
                        // tempUser.finalPrice = finalPrice
                        // console.log('finalPrice', finalPrice)
                    }
                }
                this.nowUser.userName = userName
                this.nowUser.price = price
                this.nowUser.uid = uid
                this.nowUser.finalPrice = finalPrice
                this.nowUser.face = face

                let tempUser2 = {
                    userName,
                    price,
                    uid,
                    finalPrice,
                    face
                }
                this.nowUserMap.set(userName, tempUser2)
                // console.log('this.nowUserMap', this.nowUserMap)
                // 欧皇榜
                if (blindGift.gift_tip_price >= blindGift.original_gift_price) {
                    isZhuan = true
                    this.nowUser.isZhuan = isZhuan
                    console.log('用户', userName, '赚了', price)
                    let tempUserLuck = {
                        userName,
                        price,
                        uid,
                        finalPrice,
                        face
                    }
                    if (finalPrice > 0) {
                        this.luckyMap.set(userName, tempUserLuck)
                    } else {
                        this.unluckyMap.set(userName, tempUserLuck)
                    }
                    this.luckyList = [...this.luckyMap.values()]
                    this.luckyList.sort((a, b) => b.finalPrice - a.finalPrice)
                    this.lucky = this.luckyList[0] || { userName: '无', finalPrice: 0.0, face: null }
                    // console.log('欧皇榜', this.luckyList)
                    this.unluckyList = [...this.unluckyMap.values()]
                    this.unluckyList.sort((a, b) => a.finalPrice - b.finalPrice)
                    if (this.lucky) {
                        if (this.lucky.userName == this.unlucky.userName && finalPrice > 0) {
                            // console.log('欧皇榜换人')
                            this.unlucky.userName = '无'
                            this.unlucky.finalPrice = 0.0
                            this.unlucky.face = face
                            // this.lucky.finalPrice = finalPrice
                        } else if (this.lucky.userName == this.unlucky.userName && finalPrice < 0) {
                            finalPrice = (parseFloat(this.lucky.finalPrice) + parseFloat(this.unlucky.finalPrice)).toFixed(1)
                            this.lucky.userName = '无'
                            this.lucky.finalPrice = 0.0
                            this.lucky.finalPrice = finalPrice
                            this.lucky.face = face
                        }
                        if (finalPrice < 0) {
                            this.unlucky = this.unluckyList[0]
                        }
                    } else {
                        this.lucky = {
                            userName: '无',
                            finalPrice: 0.0
                        }
                        this.unlucky = this.unluckyList[0]
                    }
                } else { // 非酋榜
                    isZhuan = false
                    this.nowUser.isZhuan = isZhuan
                    console.log('用户', userName, '亏了', price)
                    let tempUserUnLuck = {
                        userName,
                        price,
                        uid,
                        finalPrice,
                        face
                    }
                    if (finalPrice < 0) {
                        this.unluckyMap.set(userName, tempUserUnLuck)
                    } else {
                        this.luckyMap.set(userName, tempUserUnLuck)
                    }
                    this.unluckyList = [...this.unluckyMap.values()]
                    this.unluckyList.sort((a, b) => a.finalPrice - b.finalPrice)
                    this.unlucky = this.unluckyList[0] || { userName: '无', finalPrice: 0.0, face: null }
                    if (this.unlucky) {
                        if (this.lucky.userName == this.unlucky.userName && finalPrice < 0) {
                            // console.log('非酋榜换人')
                            this.lucky.userName = '无'
                            this.lucky.finalPrice = 0.0
                            // this.unlucky.finalPrice = finalPrice
                        } else if (this.lucky.userName == this.unlucky.userName && finalPrice > 0) {
                            finalPrice = (parseFloat(this.lucky.finalPrice) + parseFloat(this.unlucky.finalPrice)).toFixed(1)
                            this.unlucky.userName = '无'
                            this.unlucky.finalPrice = 0.0
                            this.unlucky.finalPrice = finalPrice
                        }
                    } else {
                        this.unlucky = {
                            userName: '无',
                            finalPrice: 0.0
                        }
                        this.luckyList = [...this.luckyMap.values()]
                        this.luckyList.sort((a, b) => b.finalPrice - a.finalPrice)
                        this.lucky = this.luckyList[0]
                    }
                }


            }
        },
        // 收到礼物
        onAddGift(dataJson) {
            console.log(dataJson)
            console.log(dataJson.super_gift_num)
            let num = dataJson.super_gift_num
            if (dataJson.blind_gift && dataJson.batch_combo_send) {
                let face = dataJson.receiver_uinfo.base.face
                let sendUser = dataJson.batch_combo_send
                let blindGift = sendUser.blind_gift
                let userName = sendUser.uname
                let uid = sendUser.uid
                // console.log('用户信息', sendUser, '礼物信息', blindGift)
                // 中间价
                let price = ((blindGift.gift_tip_price - blindGift.original_gift_price) * num / 1000).toFixed(1)
                this.total = (parseFloat(this.total) + parseFloat(price)).toFixed(1)
                // 是否赚了
                let isZhuan
                // 当前用户的总共赚/亏的价格
                let finalPrice = price

                let tempUser
                if (this.nowUserMap && this.nowUserMap.has(userName)) {
                    tempUser = this.nowUserMap.get(userName)
                    if (tempUser.userName == userName) {
                        finalPrice = (parseFloat(tempUser.finalPrice) + parseFloat(price)).toFixed(1)
                        // tempUser.finalPrice = finalPrice
                        // console.log('finalPrice', finalPrice)
                    }
                }
                this.nowUser.userName = userName
                this.nowUser.price = price
                this.nowUser.uid = uid
                this.nowUser.finalPrice = finalPrice
                this.nowUser.face = face

                let tempUser2 = {
                    userName,
                    price,
                    uid,
                    finalPrice,
                    face
                }
                this.nowUserMap.set(userName, tempUser2)
                // console.log('this.nowUserMap', this.nowUserMap)
                // 欧皇榜
                if (blindGift.gift_tip_price >= blindGift.original_gift_price) {
                    isZhuan = true
                    this.nowUser.isZhuan = isZhuan
                    console.log('用户', userName, '赚了', price)
                    let tempUserLuck = {
                        userName,
                        price,
                        uid,
                        finalPrice,
                        face
                    }
                    if (finalPrice > 0) {
                        this.luckyMap.set(userName, tempUserLuck)
                    } else {
                        this.unluckyMap.set(userName, tempUserLuck)
                    }
                    this.luckyList = [...this.luckyMap.values()]
                    this.luckyList.sort((a, b) => b.finalPrice - a.finalPrice)
                    this.lucky = this.luckyList[0] || { userName: '无', finalPrice: 0.0, face: null }
                    // console.log('欧皇榜', this.luckyList)
                    this.unluckyList = [...this.unluckyMap.values()]
                    this.unluckyList.sort((a, b) => a.finalPrice - b.finalPrice)
                    if (this.lucky) {
                        if (this.lucky.userName == this.unlucky.userName && finalPrice > 0) {
                            // console.log('欧皇榜换人')
                            this.unlucky.userName = '无'
                            this.unlucky.finalPrice = 0.0
                            this.unlucky.face = face
                            // this.lucky.finalPrice = finalPrice
                        } else if (this.lucky.userName == this.unlucky.userName && finalPrice < 0) {
                            finalPrice = (parseFloat(this.lucky.finalPrice) + parseFloat(this.unlucky.finalPrice)).toFixed(1)
                            this.lucky.userName = '无'
                            this.lucky.finalPrice = 0.0
                            this.lucky.finalPrice = finalPrice
                            this.lucky.face = face
                        }
                        if (finalPrice < 0) {
                            this.unlucky = this.unluckyList[0]
                        }
                    } else {
                        this.lucky = {
                            userName: '无',
                            finalPrice: 0.0
                        }
                        this.unlucky = this.unluckyList[0]
                    }
                } else { // 非酋榜
                    isZhuan = false
                    this.nowUser.isZhuan = isZhuan
                    console.log('用户', userName, '亏了', price)
                    let tempUserUnLuck = {
                        userName,
                        price,
                        uid,
                        finalPrice,
                        face
                    }
                    if (finalPrice < 0) {
                        this.unluckyMap.set(userName, tempUserUnLuck)
                    } else {
                        this.luckyMap.set(userName, tempUserUnLuck)
                    }
                    this.unluckyList = [...this.unluckyMap.values()]
                    this.unluckyList.sort((a, b) => a.finalPrice - b.finalPrice)
                    this.unlucky = this.unluckyList[0] || { userName: '无', finalPrice: 0.0, face: null }
                    if (this.unlucky) {
                        if (this.lucky.userName == this.unlucky.userName && finalPrice < 0) {
                            // console.log('非酋榜换人')
                            this.lucky.userName = '无'
                            this.lucky.finalPrice = 0.0
                            // this.unlucky.finalPrice = finalPrice
                        } else if (this.lucky.userName == this.unlucky.userName && finalPrice > 0) {
                            finalPrice = (parseFloat(this.lucky.finalPrice) + parseFloat(this.unlucky.finalPrice)).toFixed(1)
                            this.unlucky.userName = '无'
                            this.unlucky.finalPrice = 0.0
                            this.unlucky.finalPrice = finalPrice
                        }
                    } else {
                        this.unlucky = {
                            userName: '无',
                            finalPrice: 0.0
                        }
                        this.luckyList = [...this.luckyMap.values()]
                        this.luckyList.sort((a, b) => b.finalPrice - a.finalPrice)
                        this.lucky = this.luckyList[0]
                    }
                }


            }
        },
        // 收到弹幕
        async onAddText(data) {
            console.log(data.authorName, '说', data.content)
        }
    },
    mounted() {
        // 初始化对象
        this.init()
    }
}


</script>

<style scoped>
.gift-count{
    overflow-y: auto; /* 仅在内容超长时显示纵向滚动 */
}
.gift-count-container {
    width: 100%;
    max-width: 800px;
    margin: 70px auto 0; /* 与header高度匹配 */
    padding: 20px;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    position: relative;
    overflow: hidden; /* 禁止内容溢出 */
    display: flex;
    flex-direction: column;
}

.gift-count-container {
    width: 100%;
    max-width: 800px;
    overflow-x: hidden; /* 禁用横向滚动 */
    overflow-y: auto; /* 仅在内容超长时显示纵向滚动 */
}

.header-section {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.title {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em; /* 稍微减小标题字体 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.room-input {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.room-input-field {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px; /* 减小输入框字体 */
    outline: none;
    transition: border-color 0.3s;
}

.room-input-field:focus {
    border-color: #764ba2;
}

.start-btn,
.test-btn {
    padding: 10px 20px; /* 调整按钮内边距 */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px; /* 减小按钮字体 */
    transition: all 0.3s;
    outline: none;
}

.start-btn {
    background: linear-gradient(to right, #667eea, #764ba2);
    color: white;
}

.test-btn {
    background: linear-gradient(to right, #ff9a9e, #fad0c4);
    color: #333;
}

.start-btn:hover,
.test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.stats-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}


.total-stats {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 1em; /* 调整统计标签字体 */
    margin-bottom: 8px;
    color: #666;
}

.stat-value {
    font-size: 1.5em; /* 调整统计数值字体 */
    font-weight: bold;
}

.stat-value.positive {
    color: #4caf50;
}

.stat-value.negative {
    color: #f44336;
}

.leaderboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .leaderboard {
        grid-gap: 10px; /* 减小网格间距 */
    }
    .leaderboard-item {
        min-width: 0; /* 允许内容收缩 */
    }
}

.leaderboard-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px; /* 减小内边距 */
    border-radius: 8px; /* 稍微减小圆角 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.leaderboard-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

.leaderboard-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px; /* 减小头像尺寸 */
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.user-avatar.large {
    width: 60px; /* 减小大头像尺寸 */
    height: 60px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.user-profit {
    font-weight: bold;
}

.user-profit.positive {
    color: #4caf50;
}

.user-profit.negative {
    color: #f44336;
}

.no-data {
    text-align: center;
    color: #999;
    font-style: italic;
}

.user-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px; /* 减小内边距 */
    border-radius: 8px; /* 稍微减小圆角 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.current-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-total-profit {
    font-weight: bold;
}

.user-total-profit.positive {
    color: #4caf50;
}

.user-total-profit.negative {
    color: #f44336;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .gift-count-container {
        margin-top: 60px;
        height: calc(100vh - 60px - 10px);
        padding: 10px;
    }

    .header-section {
        padding: 15px;
    }

    .title {
        font-size: 1.5em;
    }

    .room-input {
        flex-direction: column;
        align-items: center;
    }

    .room-input-field,
    .start-btn,
    .test-btn {
        width: 100%;
        max-width: 300px;
        padding: 8px; /* 在小屏幕上进一步调整内边距 */
        font-size: 13px; /* 在小屏幕上减小字体 */
    }

    .current-user {
        flex-direction: column;
        text-align: center;
    }

    .stat-label {
        font-size: 0.9em;
    }

    .stat-value {
        font-size: 1.3em;
    }

    .leaderboard-item {
        padding: 12px;
    }

    .user-avatar {
        width: 35px;
        height: 35px;
    }

    .user-avatar.large {
        width: 50px;
        height: 50px;
    }

    .user-section {
        padding: 12px;
    }
}
</style>